//function loadData()
//{
//    eval('mockupsData = ' + loadFile(getCurrentPath() +'/js/data.json') || '{}');
//}

function cacheImages()
{
    var img = new Image();
    for (i in mockupsData)
        img.src = 'img/' + mockupsData[i].img;
}

function gotoMockup(href)
{
    id = href.substring(href.lastIndexOf('/') + 1)
    $('.hotspot').remove();
    m = mockupsData[id];
    $('#mockup img').attr('src', 'img/' + m.img);
    $('h2').text(m.title);
    $('#comment').text(m.comment);
    
    for (var i = 0; i < m.spots.length; ++i)
    {
        var spotData = m.spots[i];
        spot = $('#hotspots').append('<div id="hotspot' + (i+1) + '" class="hotspot" style=""></div>');
        spot = $('#hotspot' + (i+1));
        spot.append('<a href="' + spotData.link + '" title="' + spotData.title +
                               '" onclick="gotoMockup(this.href); return false;"></a>');
        spot.css('height', spotData.height + 'px');
        spot.css('width', spotData.width + 'px');
        spot.css('left', spotData.left + 'px');
        spot.css('top', spotData.top + 'px');
        
    }
}


